package Annotation;

import java.lang.reflect.Method;

/**
 * Created by Administrator on 2017/11/6.
 */
public class Test {
    public static void main(String[] args) throws ClassNotFoundException {
        Class clazz=Class.forName("Annotation.Guo");
        Method[] methods = clazz.getMethods();
        for (Method m:
             methods) {
            ResultMapping annotation = m.getAnnotation(ResultMapping.class);
            if(annotation!=null)
            {
                String name=annotation.name();
                String url=annotation.url();
                System.out.println(name);
                System.out.println(url);
            }
        }

    }

}
